home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
n_b_v203.zip
/
SCAN.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
57 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME SCAN .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB01.INC"
COLOR 7, 0
CLS
? "┌────────────────────────────────────────────────────────────
? "│ fSCANcrlf% ( Start%, ANY )
? "│ fSCAN% ( Start%, ANY, Chars?? )
? "├────────────────────────────────────────────────────────────────
? "│ Lookin' for something.... maybe we can help find it!
? "│ These 2 functions are almost the same but fSCANcrlf% is dedicated to
? "│ finding the `end of line` characters CHR$(13,10) while fSCAN% can be
? "│ used to detect any 1 or 2 characters. The only flaw in fSCAN% is that
? "│ it will not detect CHR$(0,X?) but that is a rare occurrence and its
? "│ speed is worth the difference!
? "│ Chars?? is best written in HEX as it is much easier to understand when
? "│ seen printed but is not necessary.
? "└─────────────────────────────────────────────────────────────────────────
?
V$ = "This is a test." + CHR$(13,10) + "This is a test."
PRINT V$
P1% = fSCAN%( 1, V$, &h0020 ) ' looking for the 1st <SPACE>
LOCATE 16, P1% : PRINT CHR$(24)
LOCATE 17, P1% : PRINT "│"
LOCATE 18, P1% : PRINT "│"
LOCATE 19, P1% : PRINT "└───────────────────────────────── <space>"
P2% = fSCAN%( 1, V$, &h6120 ) ' looking for the 1st "a "
LOCATE 16, P2% : PRINT CHR$(24,24)
LOCATE 17, P2% : PRINT "││
LOCATE 18, P2% : PRINT "└┴──────────────────────────── a<space>"
P3% = fSCANcrlf%( 1, V$ ) ' find that "CrLf"
LOCATE 16, P3% : PRINT CHR$(24,24)
LOCATE 17, P3% : PRINT "└┴───────────────────── CrLf"